﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class HouseBaseInfoAdd : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        AllowPrivateHouse();
    }

    private void AllowPrivateHouse()
    {
        bool allow = false;


        //取得部门信息
        Chenxin.Lib.House.Entity.House_BusinessSetting settings = null;
        string strCachKey = string.Format(Chenxin.Lib.Cache.CacheDataType.GLOBAL_DEPART_SETTINGS, CurrentUserInfo.DepartId);
        Chenxin.Lib.Cache.CacheService cs = new Chenxin.Lib.Cache.CacheService(Chenxin.Lib.Cache.CacheConn.xCacheConn.GLOBAL);
        settings = cs.GetObject<Chenxin.Lib.House.Entity.House_BusinessSetting>(strCachKey);
        if (!cs.Hit)
        {
            settings = Chenxin.Lib.House.DAL.House_BusinessSetting.GetModel(CurrentUserInfo.DepartId);
            if (settings != null) cs.Set(strCachKey, settings, DateTime.Now.AddDays(1));
        }
        if (settings != null)
        {
            allow = settings.AllowPrivHouse;
        }

        //if (settings == null) { Response.Redirect("~/error.aspx?mgs=未找到对应部门信息"); return; }


        if (allow)
        {
            Lit_PrivateHouse.Text = "<tr class=\"tr-HideHouse\">";
            Lit_PrivateHouse.Text += "<td style=\"text-align:right;\">";
            Lit_PrivateHouse.Text += " 房源类型：";
            Lit_PrivateHouse.Text += " </td>";
            Lit_PrivateHouse.Text += "<td>";
            Lit_PrivateHouse.Text += "    <input type=\"radio\" name=\"IsProtectHouse\" value=\"false\" checked=\"checked\" />公盘";
            Lit_PrivateHouse.Text += "    <input type=\"radio\" name=\"IsProtectHouse\" value=\"true\" />私盘";
            Lit_PrivateHouse.Text += "</td>";
            Lit_PrivateHouse.Text += "</tr>";
        }
        else
        {
            Lit_PrivateHouse.Text = "";
        }
        
    }
}
